const { override, addWebpackAlias, addWebpackResolve, addWebpackModuleRule } = require("customize-cra")
const path = require("path");
module.exports = override(
    addWebpackAlias({
        "@": path.resolve(__dirname, "src"),
        "views": path.resolve(__dirname, "src/views"),
        "common": path.resolve(__dirname, "src/common"),
        "components": path.resolve(__dirname, "src/components"),
        "api": path.resolve(__dirname, "src/api"),
    }),
    addWebpackResolve({
        extensions: ['.js', '.ts', '.jsx', '.tsx']
    }),
    addWebpackModuleRule({
        test: /\.scss$/,
        use: [
            'style-loader',
            'css-loader',
            'sass-loader',
            {
                loader: 'sass-resources-loader',
                options: {
                    resources: ['./src/global/var.scss', './src/global/fun.scss']
                }
            }
        ] 
    })
)
